Greetings,
Folder f = current
Item i
bool isFormal(Item i)
{
string iType = type(i)
if(iType == "Formal")
{
return true
}
}
for i in f do
{
if(isFormal(i))
{
print name(i)
}
}
SystemAdmin - Wed Nov 11 15:20:59 EST 2009 |
Re: Return Statement Confusion You must have a return state for the first block as shown
bool isFormal(Item i)
{ string iType = type(i)
if(iType == "Formal") return true
return false
}
|
Re: Return Statement Confusion
Yes. You are getting the run time error "function terminated without executing return statement" when you encounter a sub-folder.
void LogIt(string Message)
{
if (null Message) return
Log the Message
} // implicit return here
int GetIt(string Name)
{
if (null Name) return(-1)
string Temp = upper(Name)
if (Temp == "A") return(0)
elseif(Temp == "B") return(1)
elseif(Temp == "C") return(2)
else return(3)
// all cases are covered in the if-else clause; no return needed here
print "this statment can never execute\n"
return(-1) // Just in case, this is good practice
}
|